package com.io.controller;

import com.io.exception.SelfException;
import io.swagger.annotations.Api;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * The class/interface 过滤器异常处理
 *
 * @author guod
 * @version 1.0 use jdk 1.8
 */
@Api(tags = "过滤器异常处理")
//@RestController
public class ErrorDoController implements ErrorController {
    @Override
    public String getErrorPath() {
        return "/error";
    }

    @RequestMapping("/error")
    public void handleError() {
        throw new SelfException(401, "Token失效请重新登录！");
    }
}
